<?php
/**
 * Created by PhpStorm.
 * User: 11893
 * Date: 2018/11/14
 * Time: 16:31
 */

namespace Mars\PageCache;

use Illuminate\Contracts\Foundation\Application;
use Mars\PageCache\Exception\PathNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class Cache
{

    protected $app;

    protected $cachePath = null;

    protected $cache;

    public function __construct(CacheInterface $cache)
    {
        $this->cache = $cache;
    }

    /**
     * @param mixed $app
     * @return Cache
     */
    public function setContainer(Application $app)
    {
        $this->app = $app;
        return $this;
    }

    public function shouldCache(Request $request)
    {
        return $this->cache->shouldCache($request);
    }

    public function cache(Request $request, Response $response, $expire = 0)
    {
        return $this->cache->cache($request, $response);
    }

    public function output(Request $request = null)
    {
       return $this->cache->output($request);
    }
}